/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this service wrapper you may modify the generated sub-class of this class - WsdlObservations.as.
 */
package services.wsdlobservations
{
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.services.wrapper.WebServiceWrapper;
import com.adobe.serializers.utility.TypeUtility;
import mx.collections.ArrayCollection;
import mx.rpc.AbstractOperation;
import mx.rpc.AsyncToken;
import mx.rpc.soap.mxml.Operation;
import mx.rpc.soap.mxml.WebService;
import valueObjects.GetAllObservationsForSpeciesResponse;
import valueObjects.GetObservationsForSpeciesByDayResponse;
import valueObjects.GetPublicObservationsFileResponse;
import valueObjects.Get_observations_for_species_individual_at_location_response_list_type;

[ExcludeClass]
internal class _Super_WsdlObservations extends com.adobe.fiber.services.wrapper.WebServiceWrapper
{
    
    // Constructor
    public function _Super_WsdlObservations()
    {
        // initialize service control
        _serviceControl = new mx.rpc.soap.mxml.WebService();
        var operations:Object = new Object();
        var operation:mx.rpc.soap.mxml.Operation;

        operation = new mx.rpc.soap.mxml.Operation(null, "getObservationsForSpeciesIndividualAtLocation");
         operation.resultElementType = valueObjects.Get_observations_for_species_individual_at_location_response_list_type;
        operations["getObservationsForSpeciesIndividualAtLocation"] = operation;

        operation = new mx.rpc.soap.mxml.Operation(null, "getObservationComment");
         operation.resultType = String;
        operations["getObservationComment"] = operation;

        operation = new mx.rpc.soap.mxml.Operation(null, "getAllObservationsForSpeciesTest");
         operation.resultType = Object;
        operations["getAllObservationsForSpeciesTest"] = operation;

        operation = new mx.rpc.soap.mxml.Operation(null, "getAllObservationsForSpecies");
         operation.resultType = valueObjects.GetAllObservationsForSpeciesResponse;
        operations["getAllObservationsForSpecies"] = operation;

        operation = new mx.rpc.soap.mxml.Operation(null, "getPublicObservationsFile");
         operation.resultType = valueObjects.GetPublicObservationsFileResponse;
        operations["getPublicObservationsFile"] = operation;

        operation = new mx.rpc.soap.mxml.Operation(null, "getObservationsForSpeciesByDay");
         operation.resultType = valueObjects.GetObservationsForSpeciesByDayResponse;
        operations["getObservationsForSpeciesByDay"] = operation;

        _serviceControl.operations = operations;
        try
        {
            _serviceControl.convertResultHandler = com.adobe.serializers.utility.TypeUtility.convertResultHandler;
        }
        catch (e: Error)
        { /* Flex 3.4 and earlier does not support the convertResultHandler functionality. */ }


        preInitializeService();
        model_internal::initialize();
    }
    
    //init initialization routine here, child class to override
    protected function preInitializeService():void
    {


        _serviceControl.service = "npnAPI";
        _serviceControl.port = "SOAP11GetObservationsPort";
        wsdl = "https://www.usanpn.org/npn_portal/soap/wsdl/wsdl";
        model_internal::loadWSDLIfNecessary();
    }
    

    /**
      * This method is a generated wrapper used to call the 'getObservationsForSpeciesIndividualAtLocation' operation. It returns an mx.rpc.AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */
    public function getObservationsForSpeciesIndividualAtLocation(species_id:int, individual_id:String, year:String, station_ids:ArrayCollection) : mx.rpc.AsyncToken
    {
        model_internal::loadWSDLIfNecessary();
        var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getObservationsForSpeciesIndividualAtLocation");
		var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(species_id,individual_id,year,station_ids) ;
        return _internal_token;
    }
     
    /**
      * This method is a generated wrapper used to call the 'getObservationComment' operation. It returns an mx.rpc.AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */
    public function getObservationComment(observation_id:int) : mx.rpc.AsyncToken
    {
        model_internal::loadWSDLIfNecessary();
        var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getObservationComment");
		var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(observation_id) ;
        return _internal_token;
    }
     
    /**
      * This method is a generated wrapper used to call the 'getAllObservationsForSpeciesTest' operation. It returns an mx.rpc.AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */
    public function getAllObservationsForSpeciesTest(parameters:Object) : mx.rpc.AsyncToken
    {
        model_internal::loadWSDLIfNecessary();
        var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getAllObservationsForSpeciesTest");
		var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(parameters) ;
        return _internal_token;
    }
     
    /**
      * This method is a generated wrapper used to call the 'getAllObservationsForSpecies' operation. It returns an mx.rpc.AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */
    public function getAllObservationsForSpecies(species_id:ArrayCollection, start_date:String, end_date:String) : mx.rpc.AsyncToken
    {
        model_internal::loadWSDLIfNecessary();
        var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getAllObservationsForSpecies");
		var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(species_id,start_date,end_date) ;
        return _internal_token;
    }
     
    /**
      * This method is a generated wrapper used to call the 'getPublicObservationsFile' operation. It returns an mx.rpc.AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */
	public function getPublicObservationsFile(start_date:String, 
											  
											  end_date:String, kingdom:String, person_id:int, network:String, 
											  
											  state:String, species_ids:ArrayCollection, 
											  
											  phenophase_category:String, phenophase_id:int, 
											  
											  station_ids:ArrayCollection, file_format:String, 
											  
											  omit_definitions:Boolean) : mx.rpc.AsyncToken
	{
		model_internal::loadWSDLIfNecessary();
		var _internal_operation:mx.rpc.AbstractOperation = 
			
			_serviceControl.getOperation("getPublicObservationsFile");
		var _internal_token:mx.rpc.AsyncToken;
		
		var peid:String;
		var phid:String;
		
		if(person_id == 0)
		{
			peid = null;
		}
		else
		{
			peid = new String(person_id);
		}
		
		if(phenophase_id == 0)
		{
			phid = null;
		}
		else
		{
			phid = new String(phenophase_id);
		}
		
		_internal_token = _internal_operation.send
			
			(start_date,end_date,kingdom,peid,network,state,species_ids,phenophase_category,phid,station_ids,file_format,omit_definitions) ;
		return _internal_token;
	}
     
    /**
      * This method is a generated wrapper used to call the 'getObservationsForSpeciesByDay' operation. It returns an mx.rpc.AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */
    public function getObservationsForSpeciesByDay(start_date:String, end_date:String, species_id:ArrayCollection) : mx.rpc.AsyncToken
    {
        model_internal::loadWSDLIfNecessary();
        var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getObservationsForSpeciesByDay");
		var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(start_date,end_date,species_id) ;
        return _internal_token;
    }
     
}

}
